﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BackEnd.master" AutoEventWireup="true" CodeFile="~/Code/DMS.aspx.cs" Inherits="DMS" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cph_Main" Runat="Server">
<h3 style="text-align:center">Current Active Incidents - This will not show Incidents which have been resolved</h3>

    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" DataSourceID="AccessDataSource_allIncidents"
        Width="100%" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" 
        CellPadding="4" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:CommandField ShowSelectButton="True" />
            <asp:BoundField DataField="Incident_ID" HeaderText="Incident_ID" 
                InsertVisible="False" SortExpression="Incident_ID" />
            <asp:BoundField DataField="User_ID" HeaderText="User_ID" 
                SortExpression="User_ID" Visible="False" />
            <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" />
            <asp:BoundField DataField="Description" HeaderText="Description" 
                SortExpression="Description" />
            <asp:BoundField DataField="Landmark" HeaderText="Landmark" SortExpression="Landmark" />
            <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
            <asp:BoundField DataField="State_Name" HeaderText="State" 
                SortExpression="State_Name" />
            <asp:BoundField DataField="State" HeaderText="State" SortExpression="State" 
                Visible="False" />
            <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" />
            <asp:BoundField DataField="Date Reported" HeaderText="Date Reported" SortExpression="Date Reported" />
            <asp:BoundField DataField="Date Resolved" HeaderText="Date Resolved" SortExpression="Date Resolved" />
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
    <br />
    Search for an Incident:
    <asp:RegularExpressionValidator ID="search_validator" runat="server" 
        ControlToValidate="search_TB" ErrorMessage="Incident ID must be numeric" 
        ForeColor="Red" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
    <br />
    <asp:TextBox ID="search_TB" runat="server" Width="200px" 
        CausesValidation="True"></asp:TextBox>
    &nbsp;<asp:Button ID="search_btn"
        runat="server" Text="Search!" Width="100px" onclick="search_btn_Click" />

    <br />
    <asp:Label ID="nf_label" runat="server" ForeColor="Red" 
        Text="There is no incident by that number! Please try again!" Visible="False"></asp:Label>

    <asp:AccessDataSource ID="AccessDataSource_allIncidents" runat="server" DataFile="~/App_Data/Database.accdb"
        
        
        SelectCommand="SELECT Incidents.Incident_ID, Incidents.User_ID, Incidents.Description, Incidents.Type, Incidents.Landmark, Incidents.City, Incidents.State, Incidents.Status, Incidents.[Date Reported], Incidents.[Date Resolved], State.State_Name FROM (Incidents INNER JOIN State ON Incidents.State = State.State_ID) WHERE (Incidents.Status &lt;&gt; 'Resolved')">
    </asp:AccessDataSource>
</asp:Content>

